import { Studycontentsort } from 'src/modules/studyresources/studycontentsort/entities/studycontentsort.entity';
import { Dept } from 'src/modules/system/dept/entities/dept.entity';
import {
  Column,
  Entity,
  PrimaryGeneratedColumn,
  BeforeInsert,
  OneToOne,
  ManyToOne,
} from 'typeorm';
@Entity('studycontent')
export class Studycontent {
  @PrimaryGeneratedColumn('uuid')
  Id: string;

  @Column({ length: 100 })
  Name: string; //

  @Column({ length: 100 })
  Url: string; //

  @Column({ default: 0 })
  Deleted: number; // 删除标志，1为已删除，0为未删除

  @Column({ default: 0 })
  source: string; //

  @ManyToOne(() => Studycontentsort, (sort) => sort.content)
  sort: Studycontentsort;

  @ManyToOne(() => Dept, (department) => department.contents)
  department: Dept;
}
